<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    info: { type: Object, required: true },
  },
});
</script>

<template>
  <view class="contacts-item">
    <view class="contacts-item-content">
      <view style="display: flex; align-items: center">
        <view class="contacts-item-name">{{ info.name }}</view>
        <view class="contacts-item-phone">{{ info.phone_str }}</view>
      </view>
      <view class="contacts-item-desc" v-if="info.cardNo">
        {{ info.identity_type_name }}：{{ info.cardNo_str }}
      </view>
    </view>
    <slot />
  </view>
</template>

<style lang="scss">
.contacts-item {
  display: flex;
  align-items: center;
  padding: 30rpx;
  border-radius: 10rpx;
  background-color: #ffffff;

  .contacts-item-content {
    flex-grow: 1;
    min-width: 0;
  }

  .contacts-item-name {
    font-size: 34rpx;
    color: #333333;
    line-height: 50rpx;
    font-weight: bold;
  }

  .contacts-item-phone {
    flex-grow: 1;
    min-width: 0;
    margin-left: 20rpx;
    font-size: 28rpx;
    color: #666666;
    line-height: 50rpx;
  }

  .contacts-item-desc {
    margin-top: 4rpx;
    font-size: 28rpx;
    color: #666666;
    line-height: 50rpx;
  }
}
</style>